package com.rocky.ssm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.rocky.ssm.model.User;
import com.rocky.ssm.service.IUserService;

@Controller
@RequestMapping("/user")
public class UserController {

	@Autowired
	private IUserService userService;
	
	@RequestMapping("/{id}/list")
	public String list(@PathVariable int id,Model model){
	User user=userService.load(id);
	System.out.println(user);
	model.addAttribute("user",user);

		return "user/list";
	}
}
